home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / pibasy47.zip / ASYSENOW.ASM < prev    next >
Assembly Source File  |  1988-04-11  |  2KB  |  54 lines

  1. ;
  2. ;        Activate sending of characters
  3. ;
  4.           MOV    DX,[>Async_Uart_MCR]       ;Get modem control register
  5.           IN     AL,DX
  6.           OR     AL,$0B                     ;Turn on OUT2, DTR, and RTS
  7.           OUT    DX,AL
  8. ;
  9.           MOV    DX,[>Async_Uart_MSR]       ;Get modem status register address
  10. ;
  11. ;         Wait for DSR using Busy Wait
  12. ;
  13.           TEST   BYTE [>Async_Do_DSR],1     ;See if doing DSR check
  14.           JZ     SendNow2                   ;No -- skip check
  15. ;
  16.           MOV    CX,$FFFF                   ;Large count for busy wait
  17. ;
  18. SendNow1: IN     AL,DX                      ;Read modem status register
  19.           TEST   AL,<Async_DSR              ;Check for DSR
  20.           JNZ    SendNow2
  21.           LOOP   SendNow1
  22.           JMP    Exit                       ;Quit if we fall through
  23. ;
  24. ;         Wait for CTS using Busy Wait
  25. ;
  26. SendNow2: TEST   BYTE [>Async_Do_CTS],1     ;See if doing CTS check
  27.           JZ     SendNow4                   ;No -- skip check
  28. ;
  29.           MOV    CX,$FFFF                   ;Restore count
  30. ;
  31. SendNow3: IN     AL,DX                      ;Read modem status register
  32.           TEST   AL,<Async_CTS              ;Check for CTS
  33.           JNZ    SendNow4
  34.           LOOP   SendNow3
  35.           JMP    Exit                       ;Quit if we fall through
  36. ;
  37. ;         Wait for Transmit Hold Register Empty (THRE)
  38. ;
  39. SendNow4: MOV    CX,$FFFF                   ;Restore count
  40.           MOV    DX,[>Async_Uart_LSR]       ;Get line status register address
  41. ;
  42. SendNow5: IN     AL,DX                      ;Read line status register
  43.           TEST   AL,<Async_THRE             ;Check for THRE empty
  44.           JNZ    SendNow6
  45.           LOOP   SendNow5
  46.           JMP    Exit                       ;Quit if we fall through
  47. ;
  48. ;         Send the character when port clear
  49. ;
  50. SendNow6: MOV    AL,[BP+>C]                 ;Get character to transmit
  51.           MOV    DX,[>Async_Uart_THR]       ;Get transmit hold register
  52.           OUT    DX,AL                      ;Send the character
  53. ;
  54. Exit: